package org.blade.service;

import org.blade.entity.User;
import org.blade.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

@RestController("user")
public class UserService {

	@Autowired
	private UserMapper userMapper;
	
	@ResponseBody
	@RequestMapping("/users/{id}")
	public User queryById(@PathVariable("id")Long id){
		User user = new User(id);
		return userMapper.selectById(user);
	}
	
}
